Skip to content

Add meta canopy height v2#683

Open
yawenzzzz wants to merge 1 commit into
masterfrom
yawenz/20260721-add-canopy-height-v2
Open

Add meta canopy height v2#683
yawenzzzz wants to merge 1 commit into
masterfrom
yawenz/20260721-add-canopy-height-v2

Conversation

@yawenzzzz

@yawenzzzz yawenzzzz commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Add meta canopy height v2: https://arxiv.org/pdf/2603.06382, the final product is 1m and the high-resolution images are mostly from 2018-2020

@favyen2 favyen2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@favyen2

favyen2 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

@claude can you review this PR?

@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude finished @favyen2's task in 2m 22s —— View job


Review of PR #683 — Add meta canopy height v2

  • Gather context (read changed files, CLAUDE.md)
  • Understand request (code review)
  • Review implementation for correctness, style, tests
  • Post review feedback

Overall this is a clean, well-documented addition that follows the existing pattern used by worldcover.py (S3-hosted unsigned bucket + cached tiles.geojson/grid index + DirectMaterializeDataSource). Docs, config example, and tests (mocked integration + online) all look solid.

Bug: timeout parameter is unused

In rslearn/data_sources/meta_canopy_height.py:

  • __init__ (line 85) accepts timeout: timedelta = timedelta(seconds=60) and docs it as "timeout for HTTP requests" (line 92), and stores it as self.timeout (line 96).
  • However, self.timeout is never referenced anywhere else in the file. The boto3.client(...) call in _load_index (lines 119–125) that downloads tiles.geojson doesn't pass connect_timeout/read_timeout into botocore.client.Config(...), and there's no ingest() override (unlike worldcover.py, which actually uses self.timeout.total_seconds() in its requests.get call during ingest()) where it could otherwise be wired in.
  • Net effect: the timeout constructor argument is dead — changing it has zero effect on behavior. This looks like leftover boilerplate copied from worldcover.py's constructor without carrying over an actual use site.

Suggested fix: either apply it via botocore.client.Config(connect_timeout=.., read_timeout=..) for the s3.get_object call, or drop the unused parameter (and the timeout field/docstring) if it's not actually needed for this data source (since materialize reads go through rasterio/GDAL, not a timeout-able requests call).

Fix this →

Minor observations (not blocking)

  • docs/data_sources/meta_canopy_height_MetaCanopyHeightV2.md and the module docstring both correctly note "ingest": false is required — good, matches the fact this only implements DirectMaterializeDataSource.
  • The in-memory _grid_index/_items_by_name cache plus the on-disk tiles.geojson cache follow the exact same (pre-existing) pattern as worldcover.py, including the same benign race if multiple processes populate the cache concurrently (redundant download, but atomic rename avoids corruption) — not a new issue introduced by this PR.
  • Tests look good: mocked S3 client for unit/integration tests, plus an online test against the real bucket for an end-to-end sanity check.

Note: I wasn't able to execute ruff/pytest in this sandbox (commands required approval that wasn't available), so I couldn't confirm lint/test pass locally — this was a read-through review only. If you'd like me to actually run the test suite, please enable Bash execution in --allowedTools.

context: the data source context.
"""
super().__init__(asset_bands={"chm": [CANOPY_HEIGHT_BAND]})
self.timeout = timeout

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.timeout unused per Claude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants